/*
*/


#include <math.h>
#include "LinearWaveBC.h"


registerMooseObject("O4App", LinearWaveBC);

template <>
InputParameters
validParams<LinearWaveBC>()
{
  InputParameters params = validParams<IntegratedBC>();

  return params;
}

LinearWaveBC::LinearWaveBC(const InputParameters & parameters) : 
	IntegratedBC(parameters),
	VFVInterface(*getCheckedPointerParam<VFVProblem*>("_vfv_problem"), _assembly)

{
}

Real LinearWaveBC::computeQpResidual()
{

	RealGradient _velocity = RealGradient(1, 0, 0);
	Real vdotn = _velocity * _normals[_qp];


	Real x = _q_point[_qp](0);
	Real ul = _u_rs[_qp];
	Real ur = sin(2 * M_PI * (x - _t));
	Real flux = ul * vdotn;

	Real r = 0;
	if (vdotn >= 0)
		r += vdotn * _u[_qp] * _test[_i][_qp];
	else
		r += vdotn * ur * _test[_i][_qp];


    return r;
}

Real
LinearWaveBC::computeQpJacobian()
{
    Real r=0;

    return r;
}
